package com.casit.base.util;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.context.SecurityContextHolder;
public class UserUtil {
    private final static Logger logger = LoggerFactory.getLogger(UserUtil.class);
    /**
     * 返回当前登陆工号
     * @return
     */
    public static String getCurrentUserId(){
        try {
            return  SecurityContextHolder.getContext().getAuthentication().getName();
        }
        catch (Exception ex){
            logger.info("获取用户信息失败:",ex);
            return "";
        }

    }


}
